<template>
  <view>
        <p class="contitle" @click="click(item.BookId,i)">{{item.ConTitle}}</p>
    </view>
  </view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
        bookList:[],
			}
		},
		onLoad(option) {
			this.id=option.bookid
      console.log(this.id)
			this.getIndexData()
		},
    onReady(){
      uni.setNavigationBarTitle({
      	title:"目录"
      })
    },
		methods: {
			getIndexData:function(){
				uni.request({
					url:'http://z7jxxt5.nat.ipyingshe.com/select/content',
					method:'POST',
					data:{
						id:this.id
					},
					success:(res)=>{
							this.bookList = res.data.content;
              console.log(this.bookList)
					},
				})
			},
      toread(BookId,i){
        console.log(i)
        console.log(BookId)
        uni.navigateTo({
            url:'../read/read?bookid='+BookId+"&num="+i
        });
      }
		}
	}
</script>

<style lang="scss">
    .contitle{
      font-size: 14px;
      line-height: 40px;
      margin-left: 10px;
      height: 40px;
    }
</style>
